<?php
class Categories_model extends CI_Model{
    
    private $_table='categories';
    
    public function get_categories($params=array(),$counter=FALSE){
        $this->db->order_by('id','ASC');
        if(!$counter)
            {
                $query=$this->db->get($this->_table);
                return $query->result_array();
            }
        else
            {
                $query=$this->db->get($this->_table);
                return $query->num_rows();
            }
        
    }
    
    public function get_category_where($params=array()){
        $query=$this->db->get_where($this->_table,$params);
        return $query->result_array();
    }
    
    
    
}

